<%@ page language="java" import="java.util.*"
	import="com.csc.shopping.vo.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<jsp:include page="/manage/inc/header.jsp"></jsp:include>
<jsp:include page="/manage/inc/sidebar.jsp"></jsp:include>
<div class="main-wrap">
	<%-- <%
			//request.getAttribute() 得到的属性是Object类型
			List<Title> lists = (List<Title>)request.getAttribute("allData");
		 %> --%>
	<div class="crumb-wrap">
		<div class="crumb-list">
			<i class="icon-font"></i><a href="manager.html">首页</a><span
				class="crumb-step">&gt;</span><span class="crumb-name">导航栏管理</span>
		</div>
	</div>
	<div class="result-wrap">
		<form name="myform" id="myform" method="post">
			<div class="result-title">
				<div class="result-list">
					<a href="javascript:void(0);" onclick="addTitle(this,'dialog')"><i class="icon-font"></i>新增Title</a> 
					<a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
				</div>
			</div>
			<div class="result-content">
				<table class="result-tab" width="100%">
					<tr>
						<th class="tc" width="5%"><input class="allChoose" name=""
							type="checkbox"></th>
						<th>排序</th>
						<th>ID</th>
						<th>标题</th>
						<th>操作</th>
					</tr>
					<%
						//request.getAttribute() 得到的属性是Object类型
										List<Title> titles = (List<Title>)request.getAttribute("allData");
					                        	for(int i = 0;i<titles.size();i++){
					%>
					<tr class="message" id="maa<%=titles.get(i).getId()%>">
							<td class="tc"><input name="id[]" value="59" type="checkbox" ></td>
							<td class="titleSort">
								<input name="ids[]" value="<%=titles.get(i).getId()%>" type="hidden"> 
								<%--动态加载DOM元素需要委托事件处理,如果在DOM元素上加上了onclick onblur 等就算是事件的委托处理 否则就需要进行事件的解绑和重新得绑定,此处关于加载的顺序 --%>
								<input class="common-input sort-input" name="ord[]" value="<%=titles.get(i).getSort()%>" type="text" onblur="sortChange(event)"></td>
							<td><%=i%></td>
							<td title="<%=titles.get(i).getName()%>">
								<a target="_blank" href="javascript:void(0);" "><%=titles.get(i).getName()%></a>
							</td>
							<td>
								<a class="link-update" href="javascript:void(0);" onclick="addTitle(this)">修改</a> <!-- <a class="link-del" href="#">删除</a> -->
								<a class="lint-del" href="javascript:void(0);" onclick="deleteTitles(this,<%=titles.get(i).getId()%>);return false;">删除</a>
							</td>
					</tr>
					<%
						}
					%>
				</table>
			</div>
		</form>
	</div>
	
	<div id="dialog" class="dialog">
	<div class="inner" >
		<div><a href="javascript:void(0);" onClick="closeTitle(this);return false;">X</a></div>
    	<h2>Title</h2>
	<form action="javascript:void(0);" method="post" >
			<input type="hidden" value="" name="id">
	    	<fieldset>
	        	<span>请输入Title：</span><input type="text" name="name">
	        </fieldset>
	    	<fieldset>
	        	<span>请输入Sort：</span><input type="text" name="sort">
	        </fieldset>
	        <fieldset>
	        	<input class="self" type="reset" value="重置">
	            <input class="self" type="button" value="提交" onclick="send(this);return false;">
	        </fieldset>
	    </form>
	</div>
	</div>
	
	
</div>

<jsp:include page="/manage/inc/footer.jsp"></jsp:include>



